package org.budo.tencent.response;

import org.budo.support.http.client.Response;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * @author lmw
 */
public class UserInfoResponse extends AbstractResponse {
    private static final long serialVersionUID = -2065293051014905710L;

    public UserInfoResponse() {}

    public UserInfoResponse(Response response) {
        this.setResponse(response);

        String responseBody = response.getBody();
        JSONObject responseJson = JSON.parseObject(responseBody);

        this.setResponseJson(responseJson);
    }

    public String getFigureurlQq1() {
        return this.getResponseJson().getString("figureurl_qq_1");
    }

    public String getNickname() {
        return this.getResponseJson().getString("nickname");
    }

    @Override
    public String toString() {
        return super.toString() + ", nickname=" + this.getNickname() + ", figureurlQq1=" + this.getFigureurlQq1();
    }
}